#include<bits/stdc++.h>
#define ll long long
#define mid ((l+r)>>1)
using namespace std;
namespace IO{
    char buff[1<<21],*p1=buff,*p2=buff;
    char getch(){
        return p1==p2&&(p2=((p1=buff)+fread(buff,1,1<<21,stdin)),p1==p2)?EOF:*p1++;
    }
    template<typename T>
    void read(T &x){
        char ch=getch();int fl=1;x=0;
        while(ch>'9'||ch<'0'){if(ch=='-')fl=-1;ch=getch();}
        while(ch<='9'&&ch>='0'){x=x*10+ch-48;ch=getch();}
        x*=fl;
    }
    template<typename T,typename ...Args>
    void read(T &x,Args& ...args){
        read(x);read(args...);
    }
    char obuf[1<<21],*p3=obuf;
    void putch(char ch){
        if(p3-obuf<(1<<21))*p3++=ch;
        else fwrite(obuf,p3-obuf,1,stdout),p3=obuf,*p3++=ch;
    }
    void pc(const char *s){
    	while(*s)putch(*s),s++;
    }
    char ch[100];
    template<typename T>
    void write(T x){
        if(!x)return putch('0');
        if(x<0)putch('-'),x*=-1;
        int top=0;
        while(x)ch[++top]=x%10+48,x/=10;
        while(top)putch(ch[top]),top--;
    }
    template<typename T,typename ...Args>
    void write(T x,Args ...args){
        write(x),putch(' '),write(args...);
    }
    void flush(){fwrite(obuf,p3-obuf,1,stdout);}
}
using namespace IO;
const int mod=1e9+7;
inline int Mod(int x){return x>=mod?x-mod:x;}
#define Get(S,i) (((S)>>(i))&1)
int n,m,k;
int _s[20],tmp[20];
int calc(int s){
	for(int i=0;i<m;i++)_s[i]=Get(s,i);
	int w=1;
	while(w<m&&_s[w]==_s[0])w++;
	if(_s[0]==1){for(int i=0;i<w;i++)tmp[i]=(1<<i)*(i+1);}
	else {for(int i=0;i<w;i++)tmp[i]=-(1<<i)*(i+1);}
	for(int i=w;i<m;i++){
		tmp[i]=tmp[i-1];
		for(int j=i-1,k=2;j;j--,k<<=1){
			if(_s[j]!=_s[i]){
				tmp[i]+=k*tmp[j-1];
				break;
			}
		}
	}
	return tmp[m-1];
}
int f[((1<<12)*13)*12+5][13];
int C[15][15],ans[15];
signed main(){
	freopen("game4.in","r",stdin);
	freopen("game.out","w",stdout);
	read(n,m,k);n-=k;
	vector<int>S;
	for(int i=0;i<(1<<m);i++){
		int tmp=calc(i);
		if(tmp>0)S.push_back(tmp);
	}
	sort(S.begin(),S.end());
	f[0][0]=1;
	for(int i=1;i<=n*m*(1<<m);i++){
		for(int x:S){
			if(x>i)break;
			int _i=i-x;
			for(int j=1;j<=n;j++)
				if(f[_i][j-1])f[i][j]=Mod(f[i][j]+f[_i][j-1]);
		}
	}
	int sum=0;
	for(int i=1;i<=k;i++){
		int s=0;
		for(int j=0;j<m;j++){
			char ch=getch();
			while(ch!='N'&&ch!='C')ch=getch();
			s+=((ch=='N')<<j);
		}
		sum+=calc(s); 
	}
	if(sum<0)sum=-sum;
	for(int i=0;i<=n;i++)
		for(int j=C[i][0]=1;j<=i;j++)
			C[i][j]=Mod(C[i-1][j-1]+C[i-1][j]);
	for(int i=0;i<=n*m*(1<<m)-sum;i++){
		int j=i+sum;
		for(int s1=0;s1<=n;s1++)if(f[i][s1]){
			for(int s2=0;s1+s2<=n;s2++)if(f[j][s2]){
				ans[s1+s2]=Mod(ans[s1+s2]+1ll*C[s1+s2][s1]*f[i][s1]%mod*f[j][s2]%mod);
			}
		}
	}
	for(int i=0;i<=n;i++)write(ans[i]),putch(' ');
	return flush(),0;
}
